package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.Ban;
import com.itgaoshu.hospitalproject.bean.Paiban;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PaibanMapper {
    //查询排班
    List<Paiban> findAllPaiban(String doctorName);
    //修改排班
    @Update("UPDATE paiban SET one=#{one},two=#{two},three=#{three},four=#{four},five=#{five},six=#{six},seven=#{seven} where doctorId=#{doctorId}")
    int editPaiban(Paiban paiban);
    //查询所有的ban
    @Select("select * from ban")
    List<Ban> findAllBan();
    //添加排班的方法
    @Insert("insert into paiban (one,two,three,four,five,six,seven,doctorId)values (#{one},#{two},#{three},#{four},#{five},#{six},#{seven},#{doctorId})")
    int addPaiBan(Paiban paiban);
    //删除排班的方法
    @Delete("delete from paiban where doctorId=#{doctorId}")
    int delete(int doctorId);
    //查找id
    @Select("select count(doctorId) from paiban where doctorId=#{Id}")
    int count(int id);
}
